<?php

use Webman\Route;

// 管理后台API路由
Route::group('/app/ky_black/admin', function () {
    // 登录相关
    Route::post('/login', [plugin\ky_black\app\admin\controller\LoginController::class, 'login']);
    Route::post('/logout', [plugin\ky_black\app\admin\controller\LoginController::class, 'logout']);
    Route::get('/info', [plugin\ky_black\app\admin\controller\LoginController::class, 'info']);

    // 会员管理
    Route::group('/member', function () {
        Route::get('/list', [plugin\ky_black\app\admin\controller\MemberController::class, 'list']);
        Route::get('/detail', [plugin\ky_black\app\admin\controller\MemberController::class, 'detail']);
        Route::post('/create', [plugin\ky_black\app\admin\controller\MemberController::class, 'create']);
        Route::post('/update', [plugin\ky_black\app\admin\controller\MemberController::class, 'update']);
        Route::post('/update-status', [plugin\ky_black\app\admin\controller\MemberController::class, 'updateStatus']);
    });
    // 企业机构管理
    Route::group('/organization', function () {
        Route::get('/list', [plugin\ky_black\app\admin\controller\OrganizationController::class, 'index']);
        Route::post('/create', [plugin\ky_black\app\admin\controller\OrganizationController::class, 'create']);
        Route::post('/update', [plugin\ky_black\app\admin\controller\OrganizationController::class, 'update']);
        Route::get('/detail', [plugin\ky_black\app\admin\controller\OrganizationController::class, 'detail']);
        Route::post('/status', [plugin\ky_black\app\admin\controller\OrganizationController::class, 'status']);
    });

    // 黑卡管理
    Route::group('/black-card', function () {
        Route::get('/list', [plugin\ky_black\app\admin\controller\BlackCardController::class, 'list']);
        Route::post('/create', [plugin\ky_black\app\admin\controller\BlackCardController::class, 'create']);
        Route::post('/update', [plugin\ky_black\app\admin\controller\BlackCardController::class, 'update']);
        Route::get('/detail', [plugin\ky_black\app\admin\controller\BlackCardController::class, 'detail']);
        Route::post('/update-status', [plugin\ky_black\app\admin\controller\BlackCardController::class, 'updateStatus']);
        
        // 充值记录相关路由
        Route::get('/recharge/list', [plugin\ky_black\app\admin\controller\BlackCardRechargeController::class, 'list']);
        Route::get('/recharge/detail', [plugin\ky_black\app\admin\controller\BlackCardRechargeController::class, 'detail']);
        Route::post('/recharge/create', [plugin\ky_black\app\admin\controller\BlackCardRechargeController::class, 'create']);
        Route::post('/recharge/verify', [plugin\ky_black\app\admin\controller\BlackCardRechargeController::class, 'verify']);
        Route::post('/recharge/cancel', [plugin\ky_black\app\admin\controller\BlackCardRechargeController::class, 'cancel']);
        
        Route::get('/balance-log', [plugin\ky_black\app\admin\controller\BlackCardController::class, 'balanceLogList']);

        // 子卡管理相关路由
        Route::get('/sub/list', [plugin\ky_black\app\admin\controller\BlackCardSubController::class, 'list']);
        Route::post('/sub/create', [plugin\ky_black\app\admin\controller\BlackCardSubController::class, 'create']);
        Route::post('/sub/update', [plugin\ky_black\app\admin\controller\BlackCardSubController::class, 'update']);
        Route::post('/sub/delete', [plugin\ky_black\app\admin\controller\BlackCardSubController::class, 'delete']);
        Route::post('/sub/update-status', [plugin\ky_black\app\admin\controller\BlackCardSubController::class, 'updateStatus']);
        Route::get('/sub/detail', [plugin\ky_black\app\admin\controller\BlackCardSubController::class, 'detail']);
    });

    // 产品分类管理
    Route::get('/product_category/list', [plugin\ky_black\app\admin\controller\ProductCategoryController::class, 'list']);
    Route::post('/product_category/add', [plugin\ky_black\app\admin\controller\ProductCategoryController::class, 'add']);
    Route::post('/product_category/edit', [plugin\ky_black\app\admin\controller\ProductCategoryController::class, 'edit']);
    Route::post('/product_category/delete', [plugin\ky_black\app\admin\controller\ProductCategoryController::class, 'delete']);
    Route::post('/product_category/status', [plugin\ky_black\app\admin\controller\ProductCategoryController::class, 'status']);

    // 景区产品管理
    Route::get('/scenic_product/list', [plugin\ky_black\app\admin\controller\ScenicProductController::class, 'list']);
    Route::post('/scenic_product/add', [plugin\ky_black\app\admin\controller\ScenicProductController::class, 'add']);
    Route::post('/scenic_product/edit', [plugin\ky_black\app\admin\controller\ScenicProductController::class, 'edit']);
    Route::post('/scenic_product/delete', [plugin\ky_black\app\admin\controller\ScenicProductController::class, 'delete']);
    Route::post('/scenic_product/status', [plugin\ky_black\app\admin\controller\ScenicProductController::class, 'status']);

    // 订单管理
    Route::get('/order/list', [plugin\ky_black\app\admin\controller\OrderController::class, 'list']);
    Route::get('/order/detail', [plugin\ky_black\app\admin\controller\OrderController::class, 'detail']);
    Route::post('/order/status', [plugin\ky_black\app\admin\controller\OrderController::class, 'status']);
    Route::post('/order/refund', [plugin\ky_black\app\admin\controller\OrderController::class, 'refund']);
    Route::post('/order/complete', [plugin\ky_black\app\admin\controller\OrderController::class, 'complete']);
    Route::post('/order/cancel', [plugin\ky_black\app\admin\controller\OrderController::class, 'cancel']);

    // 商家管理
    Route::group('/business/partner', function () {
        Route::get('/list', [plugin\ky_black\app\admin\controller\BusinessPartnerController::class, 'list']);
        Route::post('', [plugin\ky_black\app\admin\controller\BusinessPartnerController::class, 'create']);
        Route::get('/options', [plugin\ky_black\app\admin\controller\BusinessPartnerController::class, 'options']);
        Route::put('/{id}', [plugin\ky_black\app\admin\controller\BusinessPartnerController::class, 'update']);
        Route::post('/status', [plugin\ky_black\app\admin\controller\BusinessPartnerController::class, 'status']);
        Route::get('/{id}', [plugin\ky_black\app\admin\controller\BusinessPartnerController::class, 'detail']);
    });

    // 合作商家管理
    Route::get('/partner/list', [plugin\ky_black\app\admin\controller\PartnerController::class, 'list']);
    Route::post('/partner/add', [plugin\ky_black\app\admin\controller\PartnerController::class, 'add']);
    Route::post('/partner/edit', [plugin\ky_black\app\admin\controller\PartnerController::class, 'edit']);
    Route::post('/partner/delete', [plugin\ky_black\app\admin\controller\PartnerController::class, 'delete']);
    Route::post('/partner/status', [plugin\ky_black\app\admin\controller\PartnerController::class, 'status']);

    // 员工管理
    Route::get('/employee/list', [plugin\ky_black\app\admin\controller\EmployeeController::class, 'list']);
    Route::post('/employee/add', [plugin\ky_black\app\admin\controller\EmployeeController::class, 'add']);
    Route::post('/employee/edit', [plugin\ky_black\app\admin\controller\EmployeeController::class, 'edit']);
    Route::post('/employee/delete', [plugin\ky_black\app\admin\controller\EmployeeController::class, 'delete']);
    Route::post('/employee/status', [plugin\ky_black\app\admin\controller\EmployeeController::class, 'status']);

    // 用户搜索接口
    Route::get('/user/search', [plugin\ky_black\app\admin\controller\UserController::class, 'search']);

    // 文件上传
    Route::post('/upload', [plugin\ky_black\app\admin\controller\UploadController::class, 'upload']);
});



